package com.maixy.dailydemo.basis;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ClassName PersonInvocationHandler
 * @Description TODO
 * @Date 2023/3/24 14:54
 * @Author Maixy
 */
public class PersonInvocationHandler implements InvocationHandler {


    private Object target;

    public PersonInvocationHandler(Object target){
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable{
        System.out.println("start");
        Object result = method.invoke(target, args);
        System.out.println("end");

        return result;
    }
}
